package com.changgou.user.controller;

import com.changgou.entity.Result;
import com.changgou.entity.StatusCode;
import com.changgou.user.pojo.Info;
import com.changgou.user.service.InfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * InfoController  TODO
 * 13418  computer
 *
 * @author zhougang
 * @date 2020/4/26 15:46
 */
@RestController
@CrossOrigin
@RequestMapping("/info")
public class InfoController {

    @Autowired
    private InfoService infoService;

    @PostMapping("/add")
    public Result add(@RequestBody Info info){
        infoService.add(info);
        return new Result(true, StatusCode.OK,"添加成功");
    }

}
